import request from '@/utils/request'

// https://api.wuliuren.com/api/customers 客户列表
export function customersList(data) {
  return request({
    url: '/admin/schools',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customers 客户详情
export function customersDetail(data) {
  return request({
    url: '/customers/' + data.id,
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customers 客户列表
export function addCustomers(data) {
  return request({
    url: '/admin/schools',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customers 客户列表
export function editCustomers(data) {
  return request({
    url: '/admin/schools' + data.id,
    method: 'put',
    data: data
  })
}


// https://api.wuliuren.com/api/customers 客户列表
export function delCustomers(data) {
  return request({
    url: '/admin/schools/' + data.id,
    method: 'delete'
  })
}





// https://api.wuliuren.com/api/customer-categories 客户分类列表
export function customersCategoriesList(data) {
  return request({
    url: 'admin/school-grades',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-categories 新增客户分类列表
export function addCustomersCategoriesList(data) {
  return request({
    url: 'admin/school-grades',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-categories 编辑客户分类列表
export function editCustomersCategories(data) {
  return request({
    url: 'admin/school-grades/' + data.id,
    method: 'PUT',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-categories 删除客户分类列表
export function delCustomersCategories(data) {
  return request({
    url: 'admin/school-grades/' + data.id,
    method: 'DELETE'
  })
}

// https://api.wuliuren.com/api/customer-sources 客户来源列表
export function customerSourcesList(data) {
  return request({
    url: 'admin/school-classes',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-sources 添加客户来源
export function addCustomerSources(data) {
  return request({
    url: 'admin/school-classes',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-sources 编辑客户来源
export function editCustomerSources(data) {
  return request({
    url: 'admin/school-classes/' + data.id,
    method: 'PUT',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-sources 删除客户来源
export function delCustomerSources(data) {
  return request({
    url: 'admin/school-classes/' + data.id,
    method: 'delete'
  })
}



export function citiesList(data) {
  return request({
    url: 'admin/cities',
    method: 'get',
    params: data
  })
}


export function addCities(data) {
  return request({
    url: 'admin/cities',
    method: 'post',
    data: data
  })
}


export function editCities(data) {
  return request({
    url: 'admin/cities/' + data.id,
    method: 'put',
    data: data
  })
}

export function delCities(data) {
  return request({
    url: 'admin/cities/' + data.id,
    method: 'delete'
  })
}

// https://api.wuliuren.com/api/customer-statuses 编辑客户状态
export function editCustomerStatuses(data) {
  return request({
    url: 'admin/cities/' + data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 联系人列表
export function getContactsList(data) {
  return request({
    url: 'customer-contacts',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 添加联系人
export function addContacts(data) {
  return request({
    url: 'customer-contacts',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 编辑联系人
export function editContacts(data) {
  return request({
    url: 'customer-contacts/'+data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-contacts 删除联系人
export function delContacts(data) {
  return request({
    url: 'customer-contacts/'+data.id,
    method: 'delete',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 开票资料列表
export function invoiceSubjects(data) {
  return request({
    url: '/customer-invoice-subjects',
    method: 'get',
    params: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 新增开票资料
export function addInvoiceSubjects(data) {
  return request({
    url: '/customer-invoice-subjects',
    method: 'post',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 编辑开票资料
export function editInvoiceSubjects(data) {
  return request({
    url: '/customer-invoice-subjects/' + data.id,
    method: 'put',
    data: data
  })
}

// https://api.wuliuren.com/api/customer-invoice-subjects 删除开票资料
export function delInvoiceSubjects(data) {
  return request({
    url: '/customer-invoice-subjects/' + data.id,
    method: 'delete'
  })
}


//admin/stats 客户统计
export function customerStats() {
  return request({
    url: '/admin/stats',
    method: 'get'
  })
}
